import { defineStore } from "pinia";
import { ref } from "vue";
import type { ResumeData } from "../types";

export const useResumeStore = defineStore(
  "resume",
  () => {
    const resumeData = ref<string>("{}");

    const setResumeData = (data: ResumeData) => {
      resumeData.value = JSON.stringify(data);
    };

    const getResumeData = () => {
      return resumeData.value;
    };

    return {
      resumeData,
      setResumeData,
      getResumeData
    };
  },
  {
    persist: true
  }
);
